import request from '@/request'

export function getUsersForAdmin(token, page, formData){
    return request({
        headers: {'Authorization': token},
        url: '/users/admin/all',
        method: 'post',
        data: {
            pageSize: page.pageSize,
            page: page.pageNumber,
            account: formData.account,
            nickname: formData.nickname,
            admin: formData.admin
            
        }

    })
}

export function changeUserStatus(token, id, newStatus){
    return request({
        headers: {'Authorization': token},
        url: `/users/admin/${id}/${newStatus}`,
        method: 'post'
    })
}

export function deleteUser(token, id){
    return request({
        headers: {'Authorization': token},
        url: `/users/admin/delete/${id}`,
        method: 'post'
    })
}